﻿<ResourceDictionary
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:local="clr-namespace:ESRI.ArcGIS.Client.Toolkit">

	<Style TargetType="local:MapProgressBar">
		<Setter Property="HorizontalAlignment" Value="Left"  />
		<Setter Property="VerticalAlignment" Value="Top"  />
		<Setter Property="FontWeight" Value="Bold"  />
		<Setter Property="FontSize" Value="10"  />
		<Setter Property="FontFamily" Value="Arial"  />
		<Setter Property="Background" Value="Gray"  />
		<Setter Property="Foreground" Value="Black"  />
		<Setter Property="TextBrush" Value="Black"  />
		<Setter Property="BorderBrush" Value="Black"  />
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="local:MapProgressBar">
					<Grid x:Name="root">

						<VisualStateManager.VisualStateGroups>
							<VisualStateGroup x:Name="CommonStates">
								<VisualState x:Name="Show">
									<Storyboard>
										<ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="root" Storyboard.TargetProperty="(UIElement.Visibility)">
											<DiscreteObjectKeyFrame KeyTime="00:00:00">
												<DiscreteObjectKeyFrame.Value>
													<Visibility>Visible</Visibility>
												</DiscreteObjectKeyFrame.Value>
											</DiscreteObjectKeyFrame>
										</ObjectAnimationUsingKeyFrames>
										<DoubleAnimation Storyboard.TargetName="root" Storyboard.TargetProperty="Opacity"
											 To="1" Duration="0:0:.5" BeginTime="0:0:0.25" />
									</Storyboard>
								</VisualState>
								<VisualState x:Name="Hide">
									<Storyboard>
										<DoubleAnimation Storyboard.TargetName="root" Storyboard.TargetProperty="Opacity"
											 To="0" Duration="0:0:0.2" />
										<ObjectAnimationUsingKeyFrames BeginTime="00:00:00.2" Duration="00:00:00.0010000" Storyboard.TargetName="root" Storyboard.TargetProperty="(UIElement.Visibility)">
											<DiscreteObjectKeyFrame KeyTime="00:00:00">
												<DiscreteObjectKeyFrame.Value>
													<Visibility>Collapsed</Visibility>
												</DiscreteObjectKeyFrame.Value>
											</DiscreteObjectKeyFrame>
										</ObjectAnimationUsingKeyFrames>
									</Storyboard>
								</VisualState>
							</VisualStateGroup>
						</VisualStateManager.VisualStateGroups>

						<ProgressBar Minimum="0" Maximum="100" x:Name="Progress"
									 Background="{TemplateBinding Background}" 
									 Foreground="{TemplateBinding Foreground}"
									 BorderBrush="{TemplateBinding BorderBrush}"
									 BorderThickness="{TemplateBinding BorderThickness}" />

						<TextBlock x:Name="ValueText"
								   HorizontalAlignment="Center" VerticalAlignment="Center"
								   FontWeight="{TemplateBinding FontWeight}"
								   FontSize="{TemplateBinding FontSize}"
								   FontFamily="{TemplateBinding FontFamily}"
								   Foreground="{TemplateBinding TextBrush}"
						/>
					</Grid>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
	
</ResourceDictionary>
